import {createApp} from 'vue'
import App from './App.vue'
import "./assets/css/index.css" // 引入tailwindcss基础样式
import store from "./store/index.js";
import router from "./router/index.js";
import Clipboard from './util/clipboard.js'
import autofocus from "./util/autofocus";
import VueClickAway from "vue3-click-away";


const app = createApp(App)

// 自动导入公共组件
const modulesFiles = import.meta.globEager('./components/*/index.vue')
// console.log(modulesFiles,"看看是什么东西")
const jieguo = Object.keys(modulesFiles).filter((item)=> true)
console.log(jieguo,"公共组件")
jieguo.forEach((item)=>{
    const moduleName = item.split("/")[2]
    const componentConfig = modulesFiles[item]
    app.component(moduleName,componentConfig.default || componentConfig)
})
// 自动导入结束
app.use(VueClickAway) // Makes 'v-click-away' directive usable in every component
app.use(store)
app.use(router)
app.use(Clipboard)
app.use(autofocus)
app.mount('#app')
